package com.first.statistics.controller;

import com.first.statistics.service.EduCourseService;
import com.first.common.pojo.EduCourse;
import com.first.common.vo.Result;
import com.first.statistics.vo.EduCourseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: SecondProject
 * @description:
 * @author: 李榕轩
 * @create: 2023-05-29 14:55
 **/
@RestController
@RequestMapping("/stat/course")
@Api(tags = "课程接口类")
public class EduCourseController {
    @Autowired
    private EduCourseService eduCourseService;
    @PostMapping("/queryAllCourseRanking")
    @ApiOperation(value = "条件查询")
    public Result queryAllCourse(@RequestBody EduCourseVo eduCourseVo) {
        //System.out.println(userVo);
        System.out.println(eduCourseVo.toString());
        List<EduCourse> eduCourses = eduCourseService.queryAllCourseRanking(eduCourseVo);

        return Result.success(eduCourses);

    }
}
